package com.linyu.huawei.simple;

import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * 明明的随机数
 *
 * 记住 jdk 有的直接用，不用干什么
 */
public class MingMingRandomNum {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // 准备容器
        HashSet<Integer> numSet = new HashSet<>();
        System.out.print("输入整数个数：");
        int count = sc.nextInt();

        for (int i = 0; i < count; i++) {
            int nowNum = sc.nextInt();
            numSet.add(nowNum);
        }
        List<Integer> collect = numSet.stream().sorted().collect(Collectors.toList());
        System.out.println(collect);

    }
}
